import { EditorContent } from '@tiptap/vue-3'
import { useEditor } from './useEditor'
import StarterKit from '@tiptap/starter-kit'


const meta = {
  title: 'Hook/useEditor',
  component: useEditor,
  tags: ['autodocs'],
  render: () => ({
    components: { 
      EditorContent,
    },
    setup() {
      const editor = useEditor({
        content: '<p>Hello World!</p>',
        extensions: [StarterKit]
      })
      return { editor }
    },
    template: `    
      <editor-content :editor="editor" />
    `
  })


} satisfies Meta<typeof useEditor>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Basic: Story = {
  name: '基础用法',
  args: {
    ...meta.args,
  },
};